import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class BitTest {
	public static final int MON = 1;
	public static final int TUE = 1 << 1;
	public static final int WED = 1 << 2;
	public static final int THU = 1 << 3;
	public static final int FRI = 1 << 4;
	public static final int SAT = 1 << 5;
	public static final int SUN = 1 << 6;
	public static void main(String[] args) {
		System.out.println(MON);
		System.out.println(TUE);
		System.out.println(WED);
		System.out.println(THU);
		System.out.println(FRI);
		System.out.println(SAT);
		System.out.println(SUN);
		System.out.println(week(7));
//		long timestamp = System.currentTimeMillis();
//		System.out.println(timestamp);
//		
//		String time = test(timestamp);
//		System.out.println(time);
//		
//		timestamp = test2(time);
//		System.out.println(timestamp);
//		
//		time = test(timestamp);
//		System.out.println(time);
//		
//		timestamp = test2(time);
//		System.out.println(timestamp);
	}
	
	public static String week(int week) {
		StringBuffer sb = new StringBuffer();
		if ((week & MON) != 0) {
			sb.append("월,");
		}
		if ((week & TUE) != 0) {
			sb.append("화,");
		}
		if ((week & WED) != 0) {
			sb.append("수,");
		}
		if ((week & THU) != 0) {
			sb.append("목,");
		}
		if ((week & FRI) != 0) {
			sb.append("금,");
		}
		if ((week & SAT) != 0) {
			sb.append("토,");
		}
		if ((week & SUN) != 0) {
			sb.append("일,");
		}
		sb.deleteCharAt(sb.length()-1);
		return sb.toString();
	}
	
	public static String test(long time){
		SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
		return sdf.format(new Timestamp(time));
	}
	
	public static long test2(String time){
		long result=0L;
		Calendar cal;
		time = "2000:01:01:"+time+":00";
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy:MM:dd:HH:mm:ss");
		System.out.println("debug"+time);
		try {
			sdf.parse(time);
			cal = sdf.getCalendar();
			Timestamp ts = new Timestamp(cal.getTime().getTime());
			result = ts.getTime();
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return result;
	}
//	public static void main(String[] args) {
//		Calendar oCalendar = Calendar.getInstance();
//		
//		System.out.print("현재 시: " + oCalendar.get(Calendar.HOUR));
//		if (oCalendar.get(Calendar.AM_PM) == 0)
//			System.out.println("am");
//		else
//			System.out.println("pm");
//
//		String tempStr = String.format("%04d %02d %02d %02d %02d %02d",
//				oCalendar.get(Calendar.YEAR),
//				(oCalendar.get(Calendar.MONTH) + 1),
//				oCalendar.get(Calendar.DAY_OF_MONTH),
//				oCalendar.get(Calendar.HOUR_OF_DAY),
//				oCalendar.get(Calendar.MINUTE), oCalendar.get(Calendar.SECOND));
//
//		System.out.println(tempStr);
//
//		Calendar cal;
//		SimpleDateFormat sd = new SimpleDateFormat("yyyyMMddHHmmss");
//		String date = new String("20061225130115");
//		try {
//			sd.parse(date);
//			cal = sd.getCalendar();
//
//			Timestamp time = new Timestamp(cal.getTime().getTime());
//			System.out.println(time.getTime() / 1000);
//			System.out.println(time);
//
//		} catch (ParseException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//
//	}
}
